/**************************
 * 发起填报接口
 * * */
import request from '@/router/axios'

// 结果填报 列表查询
// type:0 指标查看 1 结果填报 2 结果汇总页面 3 结果审核 4 指标结果 5 申诉处理
export function resultFillList(obj, type) {
    return request({
        url: `/appr-event/routineAssessKpiDetail/item/${type}`,
        method: 'get',
        params: obj
    })
}

// 结果填报 详情查询
export function resultFillDetail(itemId) {
    return request({
        url: `/appr-event/routineAssessKpiDetail/item/user/${itemId}`,
        method: 'get',
    })
}

// 结果填报 详情保存
export function resultFillSave(joinList) {
    return request({
        url: `/appr-event/routineAssessKpiDetail/item/score`,
        method: 'put',
        data: joinList
    })
}

// 结果填报 提交
export function resultFillSubmit(ids) {
    return request({
        url: `/appr-event/routineAssessKpi/process/fill/sub/${ids}`,
        method: 'put',
    })
}


// 结果填报 提交-2022、4、10
export function submitJgByTemplate(query){
  return request({
    url: '/appr-event/routineAssessKpi/submitJgByTemplate',
    method: 'post',
    data: query
  })
}
// 结果汇总 通过or驳回
export function resultPassOrReject(ids, type) {
    return request({
        url: `/appr-event/routineAssessKpi/process/fill/summary/${ids}/${type}`,
        method: 'put',
    })
}
// 结果审核&指标结果查询 type 0 结果审核 1 指标结果 2申述处理
export function resultExaminList(obj, queryType) {
    return request({
        url: `/appr-event/routineAssessKpiDetail/item/score/result/${queryType}`,
        method: 'get',
        params: obj
    })
}
// 结果汇总 结果审核&指标结果弹窗查询
export function resultExaminDetail(participantId) {
    return request({
        url: `/appr-event/routineAssessKpiDetail/item/score/result/detail/${participantId}`,
        method: 'get',
    })
}

// 结果汇总 结果审核&指标结果弹窗中分数修改
export function resultExaminDetailSave(participantId, score) {
    return request({
        url: `/appr-event/routineAssessKpiDetail/item/score/${participantId}/${score}`,
        method: 'put',
    })
}

// 结果审核 通过
export function resultExaminPass(ids) {
    return request({
        url: `/appr-event/routineAssessKpi/process/result/audit/${ids}`,
        method: 'put',
    })
}

// 新增指标考核申诉
export function addAppeal(id, reason) {
    return request({
        url: `/appr-event/routineAssessKpi/process/appeal/${id}/${reason}`,
        method: 'put',
    })
}
// 申诉处理
export function examineAppeal(id, answer, pass) {
    return request({
        url: `/appr-event/routineAssessKpi/process/appeal/audit/${id}/${answer}/${pass}`,
        method: 'put',
    })
}
export function batchStart(ids) {
    return request({
        url: `/appr-event/routineAssessKpi/process/fill/initiate/${ids}`,
        method: 'put',
    })
}



// 考核对象确认 by mingyue
export function khdxConfirm(id) {
  return request({
    url: `/appr-event/routineAssessKpi/process/resultConfirm/${id}`, //     /routineAssessKpi/process/resultConfirm/{id}
    method: 'put',
  })
}

// 回复申诉 by mingyue
export function hfSs(params,type){
  return request({
    url: `/appr-event/routineAssessKpi/process/appeal/audit/${type}`,//type 1 通过 0 不通过 /routineAssessKpi/process/appeal/audit/{pass}
    method: 'put',
    data: params
  })
}

//结果汇总 列表  by mingyue
export function resultSummaryList(obj, type) {
  return request({
    url: `/appr-event/routineAssessKpi/getResultSumPage`,
    method: 'get',
    params: obj
  })
}

// 填报审核同意/驳回
export function jgtbshSubmit(query) {
  return request({
    url: '/appr-event/routineAssessKpiSubProcess/jgtbshSubmit',
    method: 'post',
    data: query
  })
}

// 结果评审同意/驳回
export function processResultAudit(query) {
  return request({
    url: '/appr-event/routineAssessKpi/process/result/audit',
    method: 'post',
    data: query
  })
}

//结果填报导出 by mingyue
export function resultFillExportExcel(query) {
  return request({
    url: `/appr-event/routineAssessKpi/itemscore/exportExcel`,
    method: 'post',
    data: query,
    responseType: 'blob'
  })
}

// 强制确认
export function resultConfirmAll(ids) {
  return request({
    url: `/appr-event/routineAssessKpi/process/resultConfirmAll/${ids}`,
    method: 'put',
  })
}


